#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    tea = new Teacher(this);
    stu = new Student(this);

    QPushButton *button = new QPushButton(this);

    button->move(200, 400);
    button->setText("打瓦了！");

    connect(tea, &Teacher::MySignal, stu, &Student::HandleMySignal);
    connect(button, &QPushButton::clicked, stu, &Student::HandleMySignal);
}

Widget::~Widget()
{
    delete ui;
}
